//
//  PluginFactory.m
//  Runner
//
//  Created by hello on 2020/1/9.
//  Copyright © 2020 The Chromium Authors. All rights reserved.
//

#import "PluginFactory.h"
#import <Flutter/Flutter.h>

@implementation PluginFactory

+ (id)getPlugin {
    // 可以给一个plugin注册多个channel
    static NSObject<FlutterPluginRegistrar>* plugin = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        FlutterAppDelegate *registry = (FlutterAppDelegate *)[UIApplication sharedApplication].delegate;
        plugin = [registry registrarForPlugin:@"FlutterPlugin_aPlugin"];
    });

    return plugin;
}

@end
